package com.cec.home.controller
import com.cec.home.service.impl.GuideServiceImpl
import com.mongodb.BasicDBObject
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
/**
 * Created with IDEA
 * User:hxh
 * Date:16/4/23
 * Time:下午2:55
 */
@Controller
@RequestMapping("guide")
class GuideController {

    @Autowired
    GuideServiceImpl guideService

    @RequestMapping(value = "",method = RequestMethod.GET)
    def view(Model model){
        def guide = guideService.getAll([status:1] as BasicDBObject,[created:1] as BasicDBObject,null)

        model.addAttribute("guide",guide)

        return "guide"

    }
}
